package com.hex.ds.hdrs.period.task.vo;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * @Package: com.hex.ds.hdrs.period.task.vo
 * @ClassName PeriodTaskDefVo
 * @Description: 周期任务定义VO对象
 * @Author: wz.li
 * @Date 2023/3/30 11:40
 * @Version v2.0.2
 **/
@Data
@Accessors(chain = true)
public class PeriodTaskDefVo implements Serializable {

    private String pkId;

    private String taskCode;

    private String taskName;

    private String taskDesc;

    private String jobCode;

    private String shellPath;

    private String extParam;

    private String isEndTask;

    private int allowErrCount;

    private String mutexJob;

    private String mutexTask;

    private String isOrder;

    private Integer resNum;

    private Integer priorityLevel;

    private String appCode;

    private String appointAgentCode;

    private String planExecDuration;

    private String overPlanDuration;

    private String errDifferDuration;

    private String taskRemark;

    private String dependJob;

    private String dependTask;

    private List<String> dependJobCodeList;

    private List<String> dependTaskCodeList;

    public String getDependJob() {
        if (CollectionUtil.isNotEmpty(dependJobCodeList)){
            return StrUtil.join(",", dependJobCodeList);
        }
        return dependJob;
    }

    public String getDependTask() {
        if (CollectionUtil.isNotEmpty(dependTaskCodeList)){
            return StrUtil.join(",", dependJobCodeList);
        }
        return dependTask;
    }
}
